using System;
using System.Collections.Specialized;
using NCover;
using NCover.Actions;
using NCover.Utilities;

namespace NCover.CommandLine
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	class NRecover
	{

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			Arguments arguments = new Arguments();
			arguments.ValidArguments = CommandLineArgument.REPORT_NAME |
				CommandLineArgument.PUBLISH_DIR |
				CommandLineArgument.DEBUG;

			arguments.Parse(args);
			
			NRecoverAction nrecover = new NRecoverAction();

			nrecover.ReportName = arguments[CommandLineArgument.REPORT_NAME];
			nrecover.PublishDir = arguments[CommandLineArgument.PUBLISH_DIR, Environment.CurrentDirectory];
	
			nrecover.InfoOutput = new Message(Console.Out.WriteLine);

			if (arguments[CommandLineArgument.DEBUG] != null && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31) && NCover.NCoverCheck.Add(31))
			{
				nrecover.DebugOutput = new Message(Console.Out.WriteLine);
			}

			nrecover.Execute();
		}
	}
}














